home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-09-02 | 8.9 KB | 196 lines | [TEXT/CCL2] |
- Installation Instructions for AV Parser v2.0ß1p3. (28th June, 1992)
- ----------------------------------------------------------------
-
- Mark Johnson
- Cognitive and Linguistic Sciences, Box 1978
- Brown University
- Providence, RI 02912
- USA
- mj@cs.brown.edu
-
- This file tells you all you need to know to get the AV parser running on your
- MacIntosh. You need a Mac Plus or a Mac II and must be running system 7.0
- or later. It will run (just) on a machine with only 2 Mb memory, but to run
- acceptably well it really needs 3 Mb or more.
-
- The version you have here is built with Apple’s MCL 2.0ß1p3 system. It runs
- fast, but it’s a bit of a memory hog. If you can’t spare the space for this
- version you may prefer to use the AV Parser 1.3.2, which requries much less
- space.
-
- 1 Installing the AV Parser:
- ---------------------------
-
- The program is distributed as a StuffIt archive. There are actually two
- versions of this: one that just contains the source Lisp code and sample
- grammars (this one is small enought to be sent over the net) and another
- one that contains the AV Parser application itself. People without MCL 2.0
- will have to use the latter: unfortunately it is too big to to send via
- electronic mail, so you’ll need to get a copy on a floppy disk. Send
- me two empty 800k or larger Mac floppy disks if you can’t get a copy from
- anyone else.
-
- 1.0 Installation with Source code and MCL 2.0:
- ----------------------------------------------
-
- Use UnStuffIt or StuffIt to "Decode BinHex file" to get a file "AV Source Archive".
- Copy the file "AV Source Archive" to your MACL folder Use UnStuffIt or StuffIt
- 1.5.1 to unstuff the archive, creating a folder "AV", which in turn contains
- two further folders, "AV Parser" and "Sample Grammars". After starting MACL,
- load the file " Compile and Load AVP.Lisp", which will compile and then load
- all the files used by the AV Parser. This takes a while, especially on a
- small machine (take a coffee break!). When all is done, the AV Parser is
- ready to go! Next time you want to use it, just load the file " Load AVP.Lisp";
- it’s considerably faster!
-
- 1.1 Installation without MCL (from floppy disks):
- -------------------------------------------------
-
- Copy the "AV Parser Archive" onto your hard disk, and double-click on the
- archive to extract the files.. The AV Parser should be reconstructed in this
- process. You start the parser as you would any Mac application.
-
- 2 Using the AV Parser:
- ----------------------
-
- This section tells you how to use the AV Parser. We dive right in to a couple of
- trivial examples stolen from Stu Shieber’s wonderful little book "Unification-based
- Approaches to Grammar". All these examples are in the "Sample Grammars" folder.
-
- 2.1 The Simplest Unification Grammar:
- -------------------------------------
-
- Open the file "01 Simplest Grammar.Lisp". An editing window will open containing
- the contents of that file. You can edit grammars in these windows, but let’s leave
- the grammar as is for a while. Load the grammar into the parser by selecting
- "Eval Buffer" from the "Eval Menu". You’ll get a couple of cryptic warnings, but
- nothing serious should have happened.
-
- If something does go wrong, a message beginning with "Error>" appears in the Listener
- window. If this happens, enter Command-. to "clear" the error.
-
- Click on the Listener window to activate it. Following the "?" prompt enter
-
- (p uther sleeps)
-
- and press return. If all goes well, a Tree Window and an Avm Window should open,
- displaying a tree (as yet unlabelled) and a feature structure (the one associated
- with the top node of the tree). The nodes of the tree window are mouse sensitive:
- click on where the label would be if it were there, and you’ll see the feature
- structure associated with that node displayed in the Avm Window. You can change
- the size and the font used for the display using the "Edit" menu, and you can copy
- them onto the clipboard to paste them into drawing programs or word processors too.
-
- Grammar formalism note:
- -----------------------
-
- In a rule *0 refers to the feature structure of the parent, while *1, *2, ... refer
- to the feature structures of the 1st, 2nd, ... children. In a lexical entry * refers
- to the feature structure of the lexical item.
-
- Attributes are treated as partial functions, hence the "functional" syntax. See
- Johnson "Expressing Disjunctive and Negative Constraints...", Proc. 28th Annual
- Meeting of the ACL, 1990, or Johnson "Features, Frames and Quantifier Free Formulae",
- in Saint-Dizier and Szpakowicz, "Logic and Logic Grammars for Language Processing",
- Ellis-Horwood, 1990, for further explanation.
-
-
- 2.2 A Simple Grammar:
- ---------------------
-
- This grammar is exactly the same as the previous grammar, except that it uses a
- much more compact notation.
-
- The AV Parser uses notational sugar in much the way Shieber describes in Chapter 3,
- Section 4, p. 24. The "grammar reader" is itself a parser that reads the grammar
- rules and converts them into an internal representation that is actually used in
- parsing. After we’ve told the parser that we want all "category names" stored under
- the attribute "cat", which we do with the directive
-
- category-prefix = cat.
-
- we can use category names directly in syntactic rules and lexical entries. In fact,
- since in many unification grammars all non-category information appears under the
- "head" attribute, the directive
-
- value-prefix = head.
-
- directs the grammar reader to interpolate an attribute "head" before any *, *0, *1, ... .
- This makes grammar rules and lexical entries much more compact.
-
- The category-prefix is also used by the Tree Window to put category labels onto
- tree nodes. The value prefix is used by the Avm Window to omit display of
- category labels there. Both values can be changed at any time during the
- grammar file. (To see what I mean, add after the grammar but before the #] the lines
-
- category-prefix = . ; empty category prefix
- value-prefix = . ; empty value prefix
-
- and parse Uther sleeps again!).
-
- If you must get at the "whole" feature structure of a node for some reason,
- use the special forms **, **0, **1, ... . No value-prefix is interpolated
- when these are read.
-
- The directive
-
- start-category := ....
-
- defines the start-category of the grammar, where * is the value of the start-category.
-
- 2.3 Other Features
- ------------------
-
- Look at the "LFG-style Grammar" and the "Categorial-style Grammar" for two more
- complex examples. A "restrictor" can be specified in the same way the start
- category; it does not affect the results the parser returns, but only the speed
- with which it does so. Without a restrictor the parser functions essentially
- bottom-up. See Shieber, "Using Restriction ... ", Proceedings of the 22nd Annual
- Meeting of the ACL, 1985, for details.
-
- You can also declare a number of "variables" to simplify your rules and entries.
- See the Categorial-style Grammar for examples.
-
- You’re actually using a fully-featured Lisp system, even if you don’t have MCL!
- This means you can use Lisp to analyse the parser’s performance.
-
- After a parse, if you enter the following Lisp expressions in the Listener you
- get the following information:
-
- (instance-count) returns number of completed nodes found during last parse
- (length *database*) returns number of nodes searched for during last parse
- (can be less than instance-count, since a search can find
- more than one node).
-
- The restrictor can drastically affect these two values.
-
- You can see the chart working by setting the value of the Lisp variable *tracer* to
- a list. If ’seek is a member of the value of *tracer*, each time a new node is
- searched for a message will be printed. If ’found is a member of *tracer*, each
- time a complete node is found a message will be printed.
-
- (setf *tracer* ’(seek found)) ; activates tracing
- (setf *tracer* ’()) ; turns tracing off.
-
- Set the *print-circle* option under "Print Options..." under the tools menu
- if you want to see the reentrant structure printed!
-
- 3. Program files
- ----------------
-
- Compile and Load AVP.Lisp Compiles the AV Parser source files and loads them.
- Load AVP.Lisp Loads the files once compiled
-
- AV Parser.Lisp The parser proper (unifier, chart, etc.)
-
- scrollers-patch.lisp Patches and bug-fixes for Apple’s scrollers.lisp code
- pict-views.lisp Defines a class of views that cache their images as PICTs
- pict-scrap.lisp Enables cut and paste operations on PICTs
- pict-scrolling-windows.lisp Scrolling of PICT views
- graphics.lisp A general object-oriented drawing package
-
- lalr parser.lisp An LALR(1) parser generator, i.e. a kind of YACC in Lisp
- Grammar Reader Grammar.Lisp The grammar used by the above to build the grammar reader
- Grammar Parser.Lisp The grammar reader built by the lalr parser generator
- Grammar Reader Runtime.lisp Runtime support, Lisp readtable changes.
- graphics-interface.lisp Graphics interface